﻿<?php

class DefaultApp extends BaseApp
{
    function index()
    {

        if(!isset($_GET['langid']))
		{
		$_GET['langid'] ='';
		}
	    $setlang = $_GET['langid']; 
        if(!empty($setlang))
		{
				  if(preg_match("/[.\/]/",$setlang))
		          {
		            $GLOBALS['Lang']->_lang_tp = LANG;
		  
                  } 
				  else
				  {
				  $GLOBALS['Lang']->_lang_tp = $setlang;				  
				  }
		          $GLOBALS['Lang']->_set_lang($GLOBALS['Lang']->_lang_tp);
		}

		require(ROOT_PATH . '/lib/nav.lib.php');
		
		$nav = new Nav($GLOBALS['SCup']->SCup_nav_file);
		
        $this->assign('navigation', $nav->_get_nav());	

	 	$categorydata = & $GLOBALS['SCup']->_get_category_data('prot');
		
        $this->assign('categorydata', $categorydata);			
		
		
        $pic_data = include(ROOT_PATH . '/data/cache/rollpic.php'); 
		$this->assign('pic_data', $pic_data);

        $link_data = include(ROOT_PATH . '/data/cache/links.php'); 
		$this->assign('link_data', $link_data);
	    
        $this->assign('view_charset', VIEW_CHARSET);
	
        $this->assign('langtype', trim($GLOBALS['Lang']->_lang_tp));
						
        $this->assign('site_url', SITE_URL);
				
        $this->assign('page_title', SITE_TITLE);
        $this->assign('page_description', SITE_DESCRIPTION);
        $this->assign('page_keywords', SITE_KEYWORDS);
		$this->assign('bg_pic_url',SITE_URL.'/'.$GLOBALS['SCup']->SCup_name.'/view/'.VIEW_TYPE .'/style/'.CSS_TYPE.'/');	
        $this->assign('login_icon', $GLOBALS['SCup']->SCup_user_checking);		

		
        $this->display('index.view.html');
    }
  

   
}


?>